//
//  ObjcppTest.m
//  cocos2d0.99
//
//  Created by wu di on 11-8-20.
//  Copyright 2011 UTS. All rights reserved.
//

#import "ObjcppTest.hpp"

class ObjTest {
public:
	ObjTest(CGSize ix,int iy)
	{
		x = ix;
		y = iy;
	}
	
	CGSize GetX()
	{
		return x;
	}
	int GetY()
	{
		return y;
	}
private:
	CGSize x;
	int y;
};

struct CWraper
{
public:
	ObjTest pointer;
	CWraper(CGSize x,int y):pointer(x,y){}
};

@implementation ObjcppTest

- (void) init
{
	
}

- (id)initWithCGSize : (CGSize) x
{
	p = new CWraper(x,2);
	return self;
}

- (CWraper *) GetObject
{
	return p;
}

- (CGSize) GetCGSize
{
	return p->pointer.GetX();
}

- (void)dealloc
{
	delete p;
	p = NULL;
	[super dealloc];
}

@end


